package com.java1412.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author java1412
 * @create 2022-09-07 15:00
 */
@RestController
@RefreshScope // 动态刷新最新配置
public class ConfigClientController {
    // 注入码云中配置文件中config.info开头的信息
    @Value("${config.info}")
    private String configInfo;

    @GetMapping("/configInfo")
    public String getConfigInfo() {
        return configInfo;
    }
}
